\section{Config files}\label{general.configFiles}
GROOPS is controlled by XML configuration files. One or more configuration files
must be passed as arguments to GROOPS:
\begin{verbatim}
  groops config1.xml config2.xml [...]
\end{verbatim}
These files can be created with the graphical user interface program \verb|groopsGui|
in a convenient way (see section~\reference{GUI}{general.gui}).
A complete formal (computer readable) description of a configuration file
in the form of an XSD schema file can be created with the command
\begin{verbatim}
  groops --xsd groops.xsd
\end{verbatim}

A configuration file consists of a list of \reference{programs}{programType}
that are executed in sequential order. Each program comes with its own config options
and they work independently without any internal communication between programs.
Data flow between programs is realized via files. An \config{outputfile} of one program can serve as
an \config{inputfile} for the next program.
Most programs are deliberately kept small and focused on a specific task. This modularity combined with the
general purpose design of many programs enables the creation of complex workflows with little effort.
Including \reference{loops and conditions}{general.loopsAndConditions} in a config file provides even more flexibility.

Individual programs (and also other optional config elements) can be disabled
and are ignored during execution. Mandatory config elements are indicated by a star (\verb|*|).
Empty optional elements are ignored or a meaningful default value is assumed.

The elements of a configuration file can be one of the following basic data types:
\begin{itemize}
\item \verb|int|: integer number
\item \verb|uint|: unsigned integer number
\item \verb|double|: floating point number
\item \verb|angle|: given in degree
\item \verb|time|: given in modified Julian date (MJD)
\item \verb|boolean|: 0: false, 1: true
\item \verb|string|: text
\item \verb|filename|: absolute path to a file or path relative to the working directory
\item \verb|expression|: numerical expression evaluated during execution
\item \verb|doodson|: Doodson number or Darwin's name of a tidal frequency
\item \verb|gnssType|: GNSS observation type according to the RINEX 3 definition
\end{itemize}
The first 5 data types also allow numerical expressions as input in addition to pure numbers.
In addition to these basic types, there are a large number of complex data types called classes,
which are described in section~\reference{Classes}{classes}.

\subsection{Variables}\label{general.configFiles:variables}
In addition to programs a config file can also include elements called variables.
These elements are comparable to read-only variables in programming and can be referenced from any program and config element.
This can be done by either linking an element directly to a variable or
by using the name as a variable in an expression of an input field (see section~\reference{Parsers and variables}{general.parser}).
While elements can only be directly linked to variables of the same type, this also supports complex data types
such as \configClass{gravityfield}{gravityfieldType}. Thus it is possible to, for example, define a reference gravity field once
in the global section and use it multiple times in different programs.

Variables can be declared anywhere in the configuration file. Variables in locations other than the global section
have a local scope and hide global variables or variables from a hierarchy level above. They are valid after
declaration until the end of the hierarchy level is reached or a new variable with the same name is declared.

Variables are not evaluated directly when they are declared, but only later when they are used in a config element.
This means, for example, that a variable \verb|satelliteFile| with \verb|data/swarm_orbit_{loopTime:%D}.dat|
can be declared in the global section without the variable \verb|loopTime| having to be known at this time.

One special variable is \verb|groopsDataDir|, which is used as a variable in most default
file paths throughout many GROOPS programs. Since this variable is going to be needed in
most config files, it is recommended to define it in a template file that is used when creating
new config files in the GUI. See section~\reference{Graphical User Interface (GUI)}{general.gui}
for details on how to set up a template file.

In addition, the variables \verb|groopsConfigFile| and \verb|workingDir| are set automatically.

Global variables can be manipulated when running a config file by passing the argument \verb|--global <name>=<value>|.
For example, running the command
\begin{verbatim}
  groops --global timeStart=58849 --global satellite=swarm config.xml
\end{verbatim}
runs the config file \verb|config.xml| but replaces the values of the global variable \verb|timeStart|
and \verb|satellite| with \verb|58849| and \verb|swarm|, respectively. If a global variable passed as
an argument does not already exist in the config file, it will be added with the type \verb|string|.
Only the basic data types listed above are supported. This feature can be useful when running GROOPS
from the command line or from an external script file.
